package com.hengpeng.msls.expresslogin.factory;

import com.hengpeng.itfinbase.persist.MemberShare.UserType;
import com.hengpeng.msls.expresslogin.ExpressNotifyService;
import com.hengpeng.msls.expresslogin.ExpressRequestService;
import com.hengpeng.msls.expresslogin.alipay.AlipayNotifyImpl;
import com.hengpeng.msls.expresslogin.alipay.AlipayServiceImpl;
import com.hengpeng.msls.expresslogin.common.CommonRequestServiceImpl;
import com.hengpeng.msls.expresslogin.common.CommonResponseServiceImpl;

public class ExpressLoginFactory
{

	public static ExpressLoginCreator getExpressLoginCreator(UserType type)
	{
		switch (type)
		{
			case ALIPAY:
				return new ExpressLoginCreator()
				{
					public ExpressNotifyService createNotifyService()
					{
						return new AlipayNotifyImpl();
					}

					public ExpressRequestService createRequestService()
					{
						return new AlipayServiceImpl();
					}
				};
			
			
			case JYZG:
				return new ExpressLoginCreator()
				{
					public ExpressRequestService createRequestService()
					{
						return new CommonRequestServiceImpl();
					}

					public ExpressNotifyService createNotifyService()
					{
						return new CommonResponseServiceImpl();
					}
				};
			
			default:
				throw new RuntimeException("不支持的快捷登录放方式");
		}
	}
}
